import java.util.ArrayList;

public class ArrayListDemo4 {
    public static void main(String[] args) {
        ArrayList<Student> list=new ArrayList<>();
        Student student1=new Student("zsl",18);
        Student student2=new Student("lisi",15);
        Student student3=new Student("zasd",25);
        Student student4=new Student("zdfrl",38);
        list.add(student1);
        list.add(student2);
        list.add(student3);
        list.add(student4);
        for (int i = 0; i < list.size(); i++) {
            Student s =list.get(i);
            System.out.println(s.getAge()+","+s.getName());
        }
    }
}
